#!/usr/bin/env python
# -*- coding: utf-8 -*-

__version__ = "0.3.1"


from grdlog import sqlpipe
from twisted.application import internet, service

# this must came from conf.d
#os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'

factory = sqlpipe.DjangoFactory()
application = service.Application('sqlpipe', uid=2, gid=2)

# TCPServer has a factory as second arg,
# but UDPServer wants a protocol!

internet.UDPServer(514, sqlpipe.SQLPipe(factory)).setServiceParent(application)
